package Controllers;

import Models.*;
import java.util.ArrayList;
import java.util.Date;

/**
 * @author Tanja
 */
public class RentalCTR
{
    private RentalCollection rentals;

	public RentalCTR()
	{
		this.rentals = RentalCollection.getInstance();
	}

	public Rental addRental(Machine machine, Customer customer, double deposit, double pricePerDay)
	{
		Rental rental = new Rental(machine, customer, deposit, pricePerDay);
		this.rentals.addRental(rental);
		return rental;
	}

	public ArrayList<Rental> findRental(Date rentalDate, Date expectedReturnDate, Date returnDate, Machine machine, Customer customer, double deposit, double pricePerDay, double totalPrice)
	{
		return this.rentals.findRental(rentalDate, expectedReturnDate, returnDate, machine, customer, deposit, pricePerDay, totalPrice);
	}

	public ArrayList<Rental> getAllRentals()
	{
		return this.rentals.getAllRentals();
	}

	public Rental getRental(int id)
	{
		return this.rentals.getRental(id);
	}

	public void returnRental(Rental rental)
	{
		this.rentals.returnRental(rental);
	}
}